home *** CD-ROM | disk | FTP | other *** search
/ PC Elektro 3 / PC-Elektro-3-cd1.bin / KBan 2.0 / KBANSRC.LZH / SRC / PROG / DRAW.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-24  |  21.5 KB  |  721 lines

  1. /*
  2.  * the class KBAN_DRAW
  3.  * Copyright (C) 1996, 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
  4.  */
  5.  
  6. #include "stdafx.h"
  7.  
  8. #include "common/base.h"
  9.  
  10. #include "kbandef.h"
  11.  
  12. #include "draw.h"
  13.  
  14. KBAN_DRAW::KBAN_DRAW(
  15.   CDC* pDC,
  16.   const DRAW_INFO& grid,
  17.   const FLAG& fill,
  18.   const FLAG& hole,
  19.   const FLAG* lflags
  20. )
  21.   : SAFE_DRAW(pDC),
  22.     m_grid(grid),
  23.     m_fill(fill),
  24.     m_hole(hole),
  25.     m_lflags(lflags)
  26. {
  27.   m_grid_origin     = m_grid.get_grid_origin();
  28.   m_main_grid_width = m_grid.get_main_grid_width();
  29.   m_sub_grid_width  = m_grid.get_sub_grid_width();
  30.   m_grid_color      = m_grid.get_grid_color();
  31.   for(uint i = 0; i < LAYER_NUMBER; i++) {
  32.     if(lflags[i].get()) {
  33.       m_layer_attr [i].set(m_grid.get_layer_color(i), false);
  34.       m_cursor_attr[i].set(m_grid.get_cursor_color(), true );
  35.       m_target_attr[i].set(m_grid.get_target_color(), false);
  36.       m_erase_attr [i].set(m_grid.get_erase_color (), false);
  37.     } else {
  38.       m_layer_attr [i].set(RGB(0, 0, 0), true);
  39.       m_cursor_attr[i].set(RGB(0, 0, 0), true);
  40.       m_target_attr[i].set(RGB(0, 0, 0), true);
  41.       m_erase_attr [i].set(RGB(0, 0, 0), true);
  42.     }
  43.   }
  44. }
  45.  
  46. void KBAN_DRAW::draw_sub_grid(void)
  47. {
  48.   XY grid_origin = m_grid_origin;
  49.   uint grid_width = m_sub_grid_width;
  50.   XYT x;
  51.   XYT xs = Y_MIN;
  52.   for(x = grid_origin.x() % grid_width; x < X_MAX; x += grid_width) {
  53.     XY ac(x, 0);
  54.     XY pc;
  55.     m_grid.xy_ac2pc(ac, pc);
  56.     if(is_valid_x(pc.x())) {
  57.       xs = x;
  58.       break;
  59.     }
  60.   }
  61.   XYT xe = Y_MAX;
  62.   for(; x < X_MAX; x += grid_width) {
  63.     XY ac(x, 0);
  64.     XY pc;
  65.     m_grid.xy_ac2pc(ac, pc);
  66.     if(!is_valid_x(pc.x())) {
  67.       xe = x;
  68.       break;
  69.     }
  70.   }
  71.   XYT y;
  72.   XYT ys = Y_MIN;
  73.   for(y = grid_origin.y() % grid_width; y < X_MAX; y += grid_width) {
  74.     XY ac(0, y);
  75.     XY pc;
  76.     m_grid.xy_ac2pc(ac, pc);
  77.     if(is_valid_y(pc.y())) {
  78.       ys = y;
  79.       break;
  80.     }
  81.   }
  82.   XYT ye = Y_MAX;
  83.   for(; y < X_MAX; y += grid_width) {
  84.     XY ac(0, y);
  85.     XY pc;
  86.     m_grid.xy_ac2pc(ac, pc);
  87.     if(!is_valid_y(pc.y())) {
  88.       ye = y;
  89.       break;
  90.     }
  91.   }
  92.  
  93.   set_pen(PS_SOLID, 1, m_grid_color);
  94.   int xpoints = (xe - xs) / grid_width;
  95.   XYT* points = new XYT[xpoints];
  96.   for(uint ix = 0, px = xs; ix < xpoints; ix++, px += grid_width) {
  97.     XY ac(px, 0);
  98.     XY pc;
  99.     m_grid.xy_ac2pc(ac, pc);
  100.     points[ix] = pc.x();
  101.   }
  102.   for(y = ys; y < ye; y += grid_width) {
  103.     XY ac(0, y);
  104.     XY pc;
  105.     m_grid.xy_ac2pc(ac, pc);
  106.     for(uint ix = 0; ix < xpoints; ix++) {
  107.       draw_point_core(points[ix], pc.y());
  108.     }
  109.   }
  110.   delete points;
  111. }
  112.  
  113. void KBAN_DRAW::draw_main_grid(void)
  114. {
  115.   XY grid_origin = m_grid_origin;
  116.   uint grid_width = m_main_grid_width;
  117.   if(grid_width <= m_sub_grid_width) {
  118.     return;
  119.   }
  120.   XYT x;
  121.   XYT xs = Y_MIN;
  122.   for(x = grid_origin.x() % grid_width; x < X_MAX; x += grid_width) {
  123.     XY ac(x, 0);
  124.     XY pc;
  125.     m_grid.xy_ac2pc(ac, pc);
  126.     if(is_valid_x(pc.x())) {
  127.       xs = x;
  128.       break;
  129.     }
  130.   }
  131.   XYT xe = Y_MAX;
  132.   for(; x < X_MAX; x += grid_width) {
  133.     XY ac(x, 0);
  134.     XY pc;
  135.     m_grid.xy_ac2pc(ac, pc);
  136.     if(!is_valid_x(pc.x())) {
  137.       xe = x;
  138.       break;
  139.     }
  140.   }
  141.   XYT y;
  142.   XYT ys = Y_MIN;
  143.   for(y = grid_origin.y() % grid_width; y < X_MAX; y += grid_width) {
  144.     XY ac(0, y);
  145.     XY pc;
  146.     m_grid.xy_ac2pc(ac, pc);
  147.     if(is_valid_y(pc.y())) {
  148.       ys = y;
  149.       break;
  150.     }
  151.   }
  152.   XYT ye = Y_MAX;
  153.   for(; y < X_MAX; y += grid_width) {
  154.     XY ac(0, y);
  155.     XY pc;
  156.     m_grid.xy_ac2pc(ac, pc);
  157.     if(!is_valid_y(pc.y())) {
  158.       ye = y;
  159.       break;
  160.     }
  161.   }
  162.  
  163.   set_pen(PS_SOLID, 1, m_grid_color);
  164.   int xpoints = (xe - xs) / grid_width;
  165.   XYT* points = new XYT[xpoints];
  166.   for(uint ix = 0, px = xs; ix < xpoints; ix++, px += grid_width) {
  167.     XY ac(px, 0);
  168.     XY pc;
  169.     m_grid.xy_ac2pc(ac, pc);
  170.     points[ix] = pc.x();
  171.   }
  172.   for(y = ys; y < ye; y += grid_width) {
  173.     XY ac(0, y);
  174.     XY pc;
  175.     m_grid.xy_ac2pc(ac, pc);
  176.     for(uint ix = 0; ix < xpoints; ix++) {
  177.       draw_point_core(points[ix]    , pc.y()    );
  178.       draw_point_core(points[ix]    , pc.y() + 1);
  179.       draw_point_core(points[ix] + 1, pc.y()    );
  180.       draw_point_core(points[ix] + 1, pc.y() + 1);
  181.     }
  182.   }
  183.   delete points;
  184. }
  185.  
  186. void KBAN_DRAW::draw_grid(void)
  187. {
  188.   draw_sub_grid();
  189.   draw_main_grid();
  190. }
  191.  
  192. void KBAN_DRAW::draw_box_core(const XY& ac1, const XY& ac2, const DRAW_ATTR& attr)
  193. {
  194.   XY pc1, pc2;
  195.   m_grid.xy_ac2pc(ac1, pc1);
  196.   m_grid.xy_ac2pc(ac2, pc2);
  197.   COLORREF color = attr.color();
  198.   draw_plain_box(pc1.x(), pc1.y(), pc2.x(), pc2.y(), color, FALSE, attr.xor());
  199. }
  200.  
  201. void KBAN_DRAW::draw_primitive_pin_core(const PIN_ELEMENT& target, const DRAW_ATTR& attr)
  202. {
  203.   XY pc;
  204.   m_grid.xy_ac2pc(target.ac(), pc);
  205.   XYT x = pc.x();
  206.   XYT y = pc.y();
  207.   const APERTURE& apt = target.apt();
  208.   XYT w = m_grid.distance_ac2pc(apt.width());
  209.   XYT h = m_grid.distance_ac2pc(apt.height());
  210.   XYT r = w / 2;
  211.   COLORREF temp_color = attr.color();
  212.   bool     xor        = attr.xor();
  213.  
  214.   switch(apt.type()) {
  215.     case APERTURE::APT_ROUND : {
  216.       draw_plain_circle(x, y, r, temp_color, m_fill.get(), xor);
  217.       break;
  218.     }
  219.     case APERTURE::APT_SQUARE : {
  220.       int x1 = x - r;
  221.       int y1 = y - r;
  222.       int x2 = x + r - 1;
  223.       int y2 = y + r - 1;
  224.       draw_plain_box(x1, y1, x2, y2, temp_color, m_fill.get(), xor);
  225.       break;
  226.     }
  227.     case APERTURE::APT_OBLONG : {
  228.       if(w < h) {
  229.         int y1 = y - h / 2 + w / 2;
  230.         int y2 = y + h / 2 - w / 2;
  231.         if(m_fill.get()) {
  232.           draw_plain_vertical_line(x, y1, y2, w / 2, temp_color, xor);
  233.         } else {
  234.           draw_plain_circle(x, y1, w / 2, temp_color, m_fill.get(), xor);
  235.           draw_plain_circle(x, y2, w / 2, temp_color, m_fill.get(), xor);
  236.           draw_plain_vertical_line(x - w / 2, y1, y2, 1, temp_color, xor);
  237.           draw_plain_vertical_line(x + w / 2, y1, y2, 1, temp_color, xor);
  238.         }
  239.       } else {
  240.         int x1 = x - w / 2 + h / 2;
  241.         int x2 = x + w / 2 - h / 2;
  242.         if(m_fill.get()) {
  243.           draw_plain_holizontal_line(x1, x2, y, w / 2, temp_color, xor);
  244.         } else {
  245.           draw_plain_circle(x1, y, h / 2, temp_color, m_fill.get(), xor);
  246.           draw_plain_circle(x2, y, h / 2, temp_color, m_fill.get(), xor);
  247.           draw_plain_holizontal_line(x1, x2, y - h / 2, 1, temp_color, xor);
  248.           draw_plain_holizontal_line(x1, x2, y + h / 2, 1, temp_color, xor);
  249.         }
  250.       }
  251.       break;
  252.     }
  253.     case APERTURE::APT_RECTANGLE : {
  254.       int x1 = x - w / 2;
  255.       int y1 = y - h / 2;
  256.       int x2 = x + w / 2 - 1;
  257.       int y2 = y + h / 2 - 1;
  258.       draw_plain_box(x1, y1, x2, y2, temp_color, m_fill.get(), xor);
  259.       break;
  260.     }
  261.   }
  262. }
  263.  
  264. void KBAN_DRAW::draw_primitive_pin_hole_core(const PIN_ELEMENT& target, const DRAW_ATTR& attr)
  265. {
  266.   if(m_fill.get() && m_hole.get()) {
  267.     XY pc;
  268.     m_grid.xy_ac2pc(target.ac(), pc);
  269.     XYT x = pc.x();
  270.     XYT y = pc.y();
  271.     XYT dr = m_grid.distance_ac2pc(target.apt().drill()) / 2;
  272.     COLORREF color = attr.color();
  273.     draw_plain_circle(x, y, dr, color, TRUE, attr.xor());
  274.   }
  275. }
  276.  
  277. void KBAN_DRAW::draw_primitive_line_core(const LINE_ELEMENT& target, const DRAW_ATTR& attr)
  278. {
  279.   XY pc_s, pc_e;
  280.   m_grid.xy_ac2pc(target.ac_s(), pc_s);
  281.   m_grid.xy_ac2pc(target.ac_e(), pc_e);
  282.  
  283.   XYT xs = pc_s.x(), ys = pc_s.y();
  284.   XYT xe = pc_e.x(), ye = pc_e.y();
  285.   XYT width = m_grid.distance_ac2pc(target.width());
  286.   XYT r = width / 2;
  287.   COLORREF color = attr.color();
  288.   bool     xor   = attr.xor();
  289.  
  290.   if(m_fill.get()) {
  291.     draw_plain_line(xs, ys, xe, ye, width, color, xor);
  292.   } else {
  293.     if(xs == xe) {
  294.       if(xs + r - 1 < xmin()) {
  295.       } else if(xmax() < xs - r) {
  296.       } else {
  297.         draw_plain_vertical_line(xs - r    , ys, ye, 1, color, xor);
  298.         draw_plain_vertical_line(xs + r - 1, ys, ye, 1, color, xor);
  299.         draw_plain_circle(xs, ys, r, color, m_fill.get(), xor);
  300.         draw_plain_circle(xe, ye, r, color, m_fill.get(), xor);
  301.       }
  302.     } else if(ys == ye) {
  303.       if(ys + r - 1 < ymin()) {
  304.       } else if(ymax() < ys + r) {
  305.       } else {
  306.         draw_plain_holizontal_line(xs, xe, ys - r    , 1, color, xor);
  307.         draw_plain_holizontal_line(xs, xe, ys + r - 1, 1, color, xor);
  308.         draw_plain_circle(xs, ys, r, color, m_fill.get(), xor);
  309.         draw_plain_circle(xe, ye, r, color, m_fill.get(), xor);
  310.       }
  311.     } else {
  312.       if(max(xs, xe) + r - 1 < xmin()) {
  313.       } else if(xmax() < min(xs, xe) + r) {
  314.       } else if(max(ys, ye) + r - 1 < ymin()) {
  315.       } else if(ymax() < min(ys, ye) + r) {
  316.       } else {
  317.         XY o(xs, ys);
  318.         XY p(xe, ye);
  319.         double rad = o.get_radian(p) + M_PI / 2;
  320.         int dx = int(double(r) * cos(rad));
  321.         int dy = int(double(r) * sin(rad));
  322.         draw_plain_line(xs - dx, ys - dy, xe - dx, ye - dy, 1, color, xor);
  323.         draw_plain_line(xs + dx, ys + dy, xe + dx, ye + dy, 1, color, xor);
  324.         draw_plain_circle(xs, ys, r, color, m_fill.get(), xor);
  325.         draw_plain_circle(xe, ye, r, color, m_fill.get(), xor);
  326.       }
  327.     }
  328.   }
  329. }
  330.  
  331. void KBAN_DRAW::draw_primitive_pin_list_core(const PIN_LIST& target, const DRAW_ATTR& attr)
  332. {
  333.   PIN_LIST::iterator i;
  334.   TRAVERSE(target, i) {
  335.     const PIN_ELEMENT& current = *i;
  336.     draw_primitive_pin_core(current, attr);
  337.   }
  338. }
  339.  
  340. void KBAN_DRAW::draw_primitive_pin_list_hole_core(const PIN_LIST& target, const DRAW_ATTR& attr)
  341. {
  342.   PIN_LIST::iterator i;
  343.   TRAVERSE(target, i) {
  344.     const PIN_ELEMENT& current = *i;
  345.     draw_primitive_pin_hole_core(current, attr);
  346.   }
  347. }
  348.  
  349. void KBAN_DRAW::draw_primitive_line_list_core(const LINE_LIST& target, const DRAW_ATTR& attr)
  350. {
  351.   LINE_LIST::iterator i;
  352.   TRAVERSE(target, i) {
  353.     const LINE_ELEMENT& current = *i;
  354.     draw_primitive_line_core(current, attr);
  355.   }
  356. }
  357.  
  358. void KBAN_DRAW::draw_primitive_layer_core(const LAYER& target, const DRAW_ATTR& attr)
  359. {
  360.   draw_primitive_pin_list_core (target.pin_list() , attr);
  361.   draw_primitive_line_list_core(target.line_list(), attr);
  362. }
  363.  
  364. void KBAN_DRAW::draw_primitive_layer_hole_core(const LAYER& target, const DRAW_ATTR& attr)
  365. {
  366.   draw_primitive_pin_list_hole_core(target.pin_list(), attr);
  367. }
  368.  
  369. void KBAN_DRAW::draw_primitive_core(const PRIMITIVE& target, uint layer_no, const DRAW_ATTR& attr)
  370. {
  371.   draw_primitive_layer_core(target.layer(layer_no), attr);
  372. }
  373.  
  374. void KBAN_DRAW::draw_primitive_hole_core(const PRIMITIVE& target, uint layer_no, const DRAW_ATTR& attr)
  375. {
  376.   draw_primitive_layer_hole_core(target.layer(layer_no), attr);
  377. }
  378.  
  379. void KBAN_DRAW::draw_one_component_pin_list_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr)
  380. {
  381.   const PIN_LIST& list = target.layer(layer).pin_list();
  382.   PIN_LIST::iterator i;
  383.   TRAVERSE(list, i) {
  384.     PIN_ELEMENT current = *i;
  385.     current.set_ac(target.ac() + current.ac());
  386.     draw_primitive_pin_core(current, attr);
  387.   }
  388. }
  389.  
  390. void KBAN_DRAW::draw_one_component_pin_list_hole_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr)
  391. {
  392.   const PIN_LIST& list = target.layer(layer).pin_list();
  393.   PIN_LIST::iterator i;
  394.   TRAVERSE(list, i) {
  395.     PIN_ELEMENT current = *i;
  396.     current.set_ac(target.ac() + current.ac());
  397.     draw_primitive_pin_hole_core(current, attr);
  398.   }
  399. }
  400.  
  401. void KBAN_DRAW::draw_one_component_line_list_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr)
  402. {
  403.   const LINE_LIST& list = target.layer(layer).line_list();
  404.   LINE_LIST::iterator i;
  405.   TRAVERSE(list, i) {
  406.     LINE_ELEMENT current = *i;
  407.     current.set_ac_s(target.ac() + current.ac_s());
  408.     current.set_ac_e(target.ac() + current.ac_e());
  409.     draw_primitive_line_core(current, attr);
  410.   }
  411. }
  412.  
  413. void KBAN_DRAW::draw_one_component_layer_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr)
  414. {
  415.   draw_one_component_pin_list_core (target, layer, attr);
  416.   draw_one_component_line_list_core(target, layer, attr);
  417. }
  418.  
  419. void KBAN_DRAW::draw_one_component_layer_hole_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr)
  420. {
  421.   draw_one_component_pin_list_hole_core(target, layer, attr);
  422. }
  423.  
  424. void KBAN_DRAW::draw_one_component_core(const COMPONENT_ELEMENT& target, uint active_layer, const DRAW_ATTR attr_table[])
  425. {
  426.   for(uint i = 0; i < LAYER_NUMBER; i++) {
  427.     if(i == active_layer) {
  428.       continue;
  429.     }
  430.     draw_one_component_layer_core(target, i, attr_table[i]);
  431.   }
  432.   draw_one_component_layer_core(target, active_layer, attr_table[active_layer]);
  433. }
  434.  
  435. void KBAN_DRAW::draw_one_component_hole_core(const COMPONENT_ELEMENT& target, uint active_layer, const DRAW_ATTR attr_table[])
  436. {
  437.   for(uint i = 0; i < LAYER_NUMBER; i++) {
  438.     if(i == active_layer) {
  439.       continue;
  440.     }
  441.     draw_one_component_layer_hole_core(target, i, attr_table[i]);
  442.   }
  443.   draw_one_component_layer_hole_core(target, active_layer, attr_table[active_layer]);
  444. }
  445.  
  446. void KBAN_DRAW::draw_component_list_core(const COMPONENT_LIST& target, uint layer_no, const DRAW_ATTR& attr)
  447. {
  448.   COMPONENT_LIST::iterator i;
  449.   TRAVERSE(target, i) {
  450.     draw_one_component_layer_core(*i, layer_no, attr);
  451.   }
  452. }
  453.  
  454. void KBAN_DRAW::draw_component_list_hole_core(const COMPONENT_LIST& target, uint layer_no, const DRAW_ATTR& attr)
  455. {
  456.   COMPONENT_LIST::iterator i;
  457.   TRAVERSE(target, i) {
  458.     draw_one_component_layer_hole_core(*i, layer_no, attr);
  459.   }
  460. }
  461.  
  462. void KBAN_DRAW::draw_kban_data_core(const KBAN_DATA& target, uint active_layer, const DRAW_ATTR attr_table[])
  463. {
  464.   for(uint i = 0; i < LAYER_NUMBER; i++) {
  465.     if(i == active_layer) {
  466.       continue;
  467.     }
  468.     draw_primitive_core     (target.primitive()     , i, attr_table[i]);
  469.     draw_component_list_core(target.component_list(), i, attr_table[i]);
  470.   }
  471.   draw_primitive_core     (target.primitive()     , active_layer, attr_table[active_layer]);
  472.   draw_component_list_core(target.component_list(), active_layer, attr_table[active_layer]);
  473. }
  474.  
  475. void KBAN_DRAW::draw_kban_data_hole_core(const KBAN_DATA& target, uint active_layer, const DRAW_ATTR attr_table[])
  476. {
  477.   for(uint i = 0; i < LAYER_NUMBER; i++) {
  478.     if(i == active_layer) {
  479.       continue;
  480.     }
  481.     draw_primitive_hole_core     (target.primitive()     , i, attr_table[i]);
  482.     draw_component_list_hole_core(target.component_list(), i, attr_table[i]);
  483.   }
  484.   draw_primitive_hole_core     (target.primitive()     , active_layer, attr_table[active_layer]);
  485.   draw_component_list_hole_core(target.component_list(), active_layer, attr_table[active_layer]);
  486. }
  487.  
  488. //
  489. // draw_box
  490. //
  491.  
  492. void KBAN_DRAW::draw_box(const XY& ac1, const XY& ac2)
  493. { draw_box_core(ac1, ac2, m_target_attr[0]); }
  494.  
  495. void KBAN_DRAW::draw_box_cursor(const XY& ac1, const XY& ac2)
  496. { draw_box_core(ac1, ac2, m_cursor_attr[0]); }
  497.  
  498. void KBAN_DRAW::erase_box(const XY& ac1, const XY& ac2)
  499. { draw_box_core(ac1, ac2, m_erase_attr[0]); }
  500.  
  501. //
  502. // draw_primitive_pin
  503. //
  504.  
  505. void KBAN_DRAW::draw_primitive_pin(const PIN_ELEMENT& target, uint layer_no)
  506. {
  507.   draw_primitive_pin_core     (target, m_layer_attr[layer_no]);
  508.   draw_primitive_pin_hole_core(target, m_erase_attr[0       ]);
  509. }
  510.  
  511. void KBAN_DRAW::draw_primitive_pin_cursor(const PIN_ELEMENT& target)
  512. {
  513.   draw_primitive_pin_core     (target, m_cursor_attr[0]);
  514.   draw_primitive_pin_hole_core(target, m_cursor_attr[0]);
  515. }
  516.  
  517. void KBAN_DRAW::draw_primitive_pin_target(const PIN_ELEMENT& target)
  518. {
  519.   draw_primitive_pin_core     (target, m_target_attr[0]);
  520.   draw_primitive_pin_hole_core(target, m_erase_attr [0]);
  521. }
  522.  
  523. void KBAN_DRAW::erase_primitive_pin(const PIN_ELEMENT& target)
  524. {
  525.   draw_primitive_pin_core(target, m_erase_attr[0]);
  526. }
  527.  
  528. //
  529. // draw_primitive_line
  530. //
  531.  
  532. void KBAN_DRAW::draw_primitive_line(const LINE_ELEMENT& target, uint layer_no)
  533. { draw_primitive_line_core(target, m_layer_attr[layer_no]); }
  534.  
  535. void KBAN_DRAW::draw_primitive_line_cursor(const LINE_ELEMENT& target)
  536. { draw_primitive_line_core(target, m_cursor_attr[0]); }
  537.  
  538. void KBAN_DRAW::draw_primitive_line_target(const LINE_ELEMENT& target)
  539. { draw_primitive_line_core(target, m_target_attr[0]); }
  540.  
  541. void KBAN_DRAW::erase_primitive_line(const LINE_ELEMENT& target)
  542. { draw_primitive_line_core(target, m_erase_attr[0]); }
  543.  
  544. //
  545. // draw_primitive_pin_list
  546. //
  547.  
  548. void KBAN_DRAW::draw_primitive_pin_list(const PIN_LIST& target, uint layer_no)
  549. {
  550.   draw_primitive_pin_list_core(target, m_layer_attr[layer_no]);
  551.   draw_primitive_pin_list_hole_core(target, m_erase_attr[layer_no]);
  552. }
  553.  
  554. void KBAN_DRAW::draw_primitive_pin_list_cursor(const PIN_LIST& target)
  555. {
  556.   draw_primitive_pin_list_core(target, m_cursor_attr[0]);
  557.   draw_primitive_pin_list_hole_core(target, m_cursor_attr[0]);
  558. }
  559.  
  560. void KBAN_DRAW::draw_primitive_pin_list_target(const PIN_LIST& target)
  561. {
  562.   draw_primitive_pin_list_core(target, m_target_attr[0]);
  563.   draw_primitive_pin_list_hole_core(target, m_erase_attr[0]);
  564. }
  565.  
  566. void KBAN_DRAW::erase_primitive_pin_list(const PIN_LIST& target)
  567. {
  568.   draw_primitive_pin_list_core(target, m_erase_attr[0]);
  569. }
  570.  
  571. //
  572. // draw_primitive_line_list
  573. //
  574.  
  575. void KBAN_DRAW::draw_primitive_line_list(const LINE_LIST& target, uint layer_no)
  576. { draw_primitive_line_list_core(target, m_layer_attr[layer_no]); }
  577.  
  578. void KBAN_DRAW::draw_primitive_line_list_cursor(const LINE_LIST& target)
  579. { draw_primitive_line_list_core(target, m_cursor_attr[0]); }
  580.  
  581. void KBAN_DRAW::draw_primitive_line_list_target(const LINE_LIST& target)
  582. { draw_primitive_line_list_core(target, m_target_attr[0]); }
  583.  
  584. void KBAN_DRAW::erase_primitive_line_list(const LINE_LIST& target)
  585. { draw_primitive_line_list_core(target, m_erase_attr[0]); }
  586.  
  587. //
  588. // draw_primitive_layer
  589. //
  590.  
  591. void KBAN_DRAW::draw_primitive_layer(const LAYER& target, uint layer_no)
  592. {
  593.   draw_primitive_layer_core     (target, m_layer_attr[layer_no]);
  594.   draw_primitive_layer_hole_core(target, m_erase_attr[0       ]);
  595. }
  596.  
  597. void KBAN_DRAW::draw_primitive_layer_cursor(const LAYER& target)
  598. {
  599.   draw_primitive_layer_core     (target, m_cursor_attr[0]);
  600.   draw_primitive_layer_hole_core(target, m_cursor_attr[0]);
  601. }
  602.  
  603. void KBAN_DRAW::draw_primitive_layer_target(const LAYER& target)
  604. {
  605.   draw_primitive_layer_core     (target, m_target_attr[0]);
  606.   draw_primitive_layer_hole_core(target, m_erase_attr [0]);
  607. }
  608.  
  609. void KBAN_DRAW::erase_primitive_layer(const LAYER& target)
  610. {
  611.   draw_primitive_layer_core(target, m_erase_attr[0]);
  612. }
  613.  
  614. //
  615. // draw_primitive
  616. //
  617.  
  618. void KBAN_DRAW::draw_primitive(const PRIMITIVE& target, uint layer_no)
  619. {
  620.   draw_primitive_core     (target, layer_no, m_layer_attr[layer_no]);
  621.   draw_primitive_hole_core(target, layer_no, m_erase_attr[layer_no]);
  622. }
  623.  
  624. void KBAN_DRAW::draw_primitive_cursor(const PRIMITIVE& target, uint layer_no)
  625. {
  626.   draw_primitive_core     (target, layer_no, m_cursor_attr[0]);
  627.   draw_primitive_hole_core(target, layer_no, m_cursor_attr[0]);
  628. }
  629.  
  630. void KBAN_DRAW::draw_primitive_target(const PRIMITIVE& target, uint layer_no)
  631. {
  632.   draw_primitive_core     (target, layer_no, m_target_attr[0]);
  633.   draw_primitive_hole_core(target, layer_no, m_erase_attr [0]);
  634. }
  635.  
  636. void KBAN_DRAW::erase_primitive(const PRIMITIVE& target, uint layer_no)
  637. {
  638.   draw_primitive_core(target, layer_no, m_erase_attr[0]);
  639. }
  640.  
  641. //
  642. // draw_one_component
  643. //
  644.  
  645. void KBAN_DRAW::draw_one_component(const COMPONENT_ELEMENT& target, uint active_layer)
  646. {
  647.   draw_one_component_core     (target, active_layer, m_layer_attr);
  648.   draw_one_component_hole_core(target, active_layer, m_erase_attr);
  649. }
  650.  
  651. void KBAN_DRAW::draw_one_component_cursor(const COMPONENT_ELEMENT& target, uint active_layer)
  652. {
  653.   draw_one_component_core     (target, active_layer, m_cursor_attr);
  654.   draw_one_component_hole_core(target, active_layer, m_cursor_attr);
  655. }
  656.  
  657. void KBAN_DRAW::draw_one_component_target(const COMPONENT_ELEMENT& target, uint active_layer)
  658. {
  659.   draw_one_component_core     (target, active_layer, m_target_attr);
  660.   draw_one_component_hole_core(target, active_layer, m_erase_attr );
  661. }
  662.  
  663. void KBAN_DRAW::erase_one_component(const COMPONENT_ELEMENT& target, uint active_layer)
  664. {
  665.   draw_one_component_core(target, active_layer, m_erase_attr);
  666. }
  667.  
  668. //
  669. // draw_component_list
  670. //
  671.  
  672. void KBAN_DRAW::draw_component_list(const COMPONENT_LIST& target, uint layer_no)
  673. {
  674.   draw_component_list_core     (target, layer_no, m_layer_attr[layer_no]);
  675.   draw_component_list_hole_core(target, layer_no, m_erase_attr[0       ]);
  676. }
  677.  
  678. void KBAN_DRAW::draw_component_list_cursor(const COMPONENT_LIST& target, uint layer_no)
  679. {
  680.   draw_component_list_core     (target, layer_no, m_target_attr[layer_no]);
  681.   draw_component_list_hole_core(target, layer_no, m_cursor_attr[0       ]);
  682. }
  683.  
  684. void KBAN_DRAW::draw_component_list_target(const COMPONENT_LIST& target, uint layer_no)
  685. {
  686.   draw_component_list_core     (target, layer_no, m_target_attr[layer_no]);
  687.   draw_component_list_hole_core(target, layer_no, m_erase_attr [0       ]);
  688. }
  689.  
  690. void KBAN_DRAW::erase_component_list(const COMPONENT_LIST& target, uint layer_no)
  691. {
  692.   draw_component_list_core(target, layer_no, m_erase_attr[layer_no]);
  693. }
  694.  
  695. //
  696. // draw_kban_data
  697. //
  698.  
  699. void KBAN_DRAW::draw_kban_data(const KBAN_DATA& target, uint active_layer)
  700. {
  701.   draw_kban_data_core     (target, active_layer, m_layer_attr);
  702.   draw_kban_data_hole_core(target, active_layer, m_erase_attr);
  703. }
  704.  
  705. void KBAN_DRAW::draw_kban_data_cursor(const KBAN_DATA& target, uint active_layer)
  706. {
  707.   draw_kban_data_core     (target, active_layer, m_cursor_attr);
  708.   draw_kban_data_hole_core(target, active_layer, m_cursor_attr);
  709. }
  710.  
  711. void KBAN_DRAW::draw_kban_data_target(const KBAN_DATA& target, uint active_layer)
  712. {
  713.   draw_kban_data_core     (target, active_layer, m_target_attr);
  714.   draw_kban_data_hole_core(target, active_layer, m_erase_attr );
  715. }
  716.  
  717. void KBAN_DRAW::erase_kban_data(const KBAN_DATA& target, uint active_layer)
  718. {
  719.   draw_kban_data_core(target, active_layer, m_erase_attr);
  720. }
  721.